Skip to content

Instantly share code, notes, and snippets.

View lk251's full-sized avatar

lk251

View GitHub Profile
@Akhu
Akhu / .gitignore
Last active January 2, 2023 11:10
Xcode 12 + Swift UI Gitignore
# Created by https://www.toptal.com/developers/gitignore/api/swiftpackagemanager,swift,xcode,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=swiftpackagemanager,swift,xcode,macos
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
@elhardoum
elhardoum / README.md
Last active June 11, 2019 17:22
Capture handles from Twitter

This is a workaround for Twitter search API being limited to only tweets from the past week.

Open Twitter on your favourite browser, open dev-tools, then go to console.

Make sure you are on Twitter search page, searching for your mentioned handle or hashtag or whatever.

Enter the code, it will only capture the handles but you can alter it to capture more data of your choosing.

It will attempt to adjust the page scroll to reach the bottom, in order to load more tweets, until you reach the end.

_author__ = 'Fabian Isensee'
from collections import OrderedDict
from lasagne.layers import InputLayer, ConcatLayer, Pool2DLayer, ReshapeLayer, DimshuffleLayer, NonlinearityLayer, DropoutLayer, Upscale2DLayer, Upscale3DLayer, BatchNormLayer, batch_norm
from lasagne.layers.dnn import Conv3DDNNLayer as ConvLayer, Pool3DDNNLayer as PoolLayer
import lasagne
from lasagne.init import HeNormal
def build_UNet(n_input_channels=1, BATCH_SIZE=None, num_output_classes=2, pad='same', nonlinearity=lasagne.nonlinearities.elu, input_dim=(128, 128), depth=32, base_n_filters=32, kernel_size=3, do_dropout=False):
net = OrderedDict()
@joepie91
joepie91 / 1.md
Last active June 25, 2023 09:03
Errors 'bubbling up the chain' with Promises, and catching specific kinds of errors (with Bluebird)

Promise.try is explained here.

@edsu
edsu / replies.py
Last active December 7, 2022 18:59
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
@pawarvijay
pawarvijay / app.js
Last active January 9, 2022 17:51
how to send http post request by curl to node expressjs
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(function (req, res, next) {
console.log('aeee ' + JSON.stringify(req.body))
next()
@joepie91
joepie91 / promises-reading-list.md
Last active June 25, 2023 09:12
Promises (Bluebird) reading list

Promises reading list

This is a list of examples and articles, in roughly the order you should follow them, to show and explain how promises work and why you should use them. I'll probably add more things to this list over time.

This list primarily focuses on Bluebird, but the basic functionality should also work in ES6 Promises, and some examples are included on how to replicate Bluebird functionality with ES6 promises. You should still use Bluebird where possible, though - they are faster, less error-prone, and have more utilities.

I'm available for tutoring and code review :)

You may reuse all gists for any purpose under the WTFPL / CC0 (whichever you prefer).

@seanbehan
seanbehan / get-words-from-epubs.py
Last active February 24, 2018 13:44
using generator comprehensions in python to extract words from epub files
from glob import glob
from os.path import basename
from zipfile import ZipFile, is_zipfile
from re import findall
from nltk.corpus import words
ROOT_PATH = '/Volumes/USB20FD/downloads/*.epub'
WORDS = set(words.words())
groups = (group for group in zip(*(iter(glob(ROOT_PATH)),)*100))
(require 'org-table)
(require 'org-clock)
(defun clocktable-by-tag/shift-cell (n)
(let ((str ""))
(dotimes (i n)
(setq str (concat str "| ")))
str))
(defun clocktable-by-tag/insert-tag (params)
@yanofsky
yanofsky / LICENSE
Last active June 5, 2024 21:51
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit