Skip to content

Instantly share code, notes, and snippets.

View Winterflower's full-sized avatar
🥰
Learning all about NLP!

Camilla Montonen Winterflower

🥰
Learning all about NLP!
View GitHub Profile
@benwtrent
benwtrent / ESModel.py
Last active February 11, 2020 17:53
model transformers
from typing import List
def add_if_exists(d: dict, k: str, v) -> dict:
"""
:param v:
:param k:
:type d: object
"""
if v is not None:
@jessfraz
jessfraz / clone.c
Last active September 25, 2018 19:40
clone.c
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <sys/wait.h>
#include <errno.h>
#define STACKSIZE (1024*1024)
static char child_stack[STACKSIZE];
#!/usr/bin/env python
"""
Python script for building documentation.
To build the docs you must have all optional dependencies for pandas
installed. See the installation instructions for a list of these.
Note: currently latex builds do not work because of table formats that are not
supported in the latex generation.
@tamitutor
tamitutor / osx-mongodb-rlimits-fix.md
Last active August 21, 2024 17:50
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at basho/basho_docs#1402)

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

...containing:

@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active September 20, 2024 17:28
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@cslarsen
cslarsen / sendeth.py
Created April 27, 2014 07:14
One way of sending raw Ethernet packets in Python
"""Demonstrates how to construct and send raw Ethernet packets on the
network.
You probably need root privs to be able to bind to the network interface,
e.g.:
$ sudo python sendeth.py
"""
from socket import *
@brendajin
brendajin / gist:8190614
Last active January 1, 2016 19:29
New Year's Resolutions for the Burgeoning Self-Taught Female Hacker

#New Year's Resolutions for the Burgeoning Self-Taught Female Hacker

Last January, I attended my first hackathon and commited to learning to code. Fast forward to May, and I landed my first full-time position as a Developer.

When people ask me how I did it, I always say that the most challenging aspect of a career transition is psychological. The technical learning can be done with elbow grease, but no career transition is possible without psychological fortitude.

Along the way, there will be self-doubt, hundreds of rejected job applications, cold recruiters, and days when you feel like your goal is too far beyond your reach. To this, I say: you can do it.

So in light of the new year, I've put together a non-prescriptive list to inspire your 2014 resolutions. If you are a burgeoning self-taught female hacker: you go, girl.

@dmarx
dmarx / LinkFixerClone.py
Last active January 19, 2021 02:20
A simple LinkFixerBot clone developed as a demonstration for anyone who is curious how a simple reddit bot might be coded. To kill this code, spam "Ctrl+C" until it catches the exception.
import praw # simple interface to the reddit API, also handles rate limiting of requests
import re
from collections import deque
from time import sleep
USERNAME = "Your username here"
PASSWORD = "Your password here"
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit"
r = praw.Reddit(USERAGENT)
@codeeval
codeeval / sample.py
Created October 3, 2011 02:13
Sample code to read in test cases
# On CodeEval, test cases are read in from a file which is the first argument to your program
# Open the file and read in line by line. Each line represents a different test case
# (unless given different instructions in the challenge description)
import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
# ignore test if it is an empty line