Skip to content

Instantly share code, notes, and snippets.

View calufa's full-sized avatar

Carlos calufa

View GitHub Profile
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 27, 2024 15:49
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
num_epochs = 100
total_series_length = 50000
truncated_backprop_length = 15
state_size = 4
num_classes = 2
@jaron
jaron / urban-sound-cnn-salamon.py
Last active July 12, 2019 15:07
A Keras/Tensorflow implementation of the 5-layer CNN described in Salamon and Bello's paper (https://arxiv.org/pdf/1608.04363.pdf). See http://aqibsaeed.github.io/2016-09-24-urban-sound-classification-part-2/ for a description on how to create the data this uses.
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers import SGD
from keras.regularizers import l2, activity_l2
from keras.utils import np_utils
from sklearn import metrics
# to run this code, you'll need to load the following data:
@jaron
jaron / urban-sound-cnn-1.py
Created October 4, 2016 15:10
A stacked convolutional neural network (CNN) to classify the Urban Sound 8K dataset. Uses Tensorflow, with Keras to provide some higher-level abstractions. Inspired by a blog post by Aaqib Saeed (http://aqibsaeed.github.io/2016-09-24-urban-sound-classification-part-2/)
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers import Adam
from keras.utils import np_utils
from sklearn import metrics
# to run this code, you'll need to load the following data:
# train_x, train_y
@sono-bfio
sono-bfio / bird_classifier.py
Created August 31, 2016 17:10
cifar-10 and tflearn
from __future__ import division, print_function, absolute_import
# Import tflearn and some helpers
import tflearn
from tflearn.data_utils import shuffle
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
@acolyer
acolyer / service-checklist.md
Last active January 30, 2024 17:39
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@bennadel
bennadel / jquery.event-trace.js
Created June 27, 2012 15:04
Tracing Event Binding And Event Triggering In jQuery
// Create a private scope.
(function( $, on ){
// I proxy the given function and return the resultant GUID
// value that jQuery has attached to the function.
var createAndReturnProxyID = function( target ){
// When generating the proxy, it doesn't matter what the
// "context" is (window in this case); we never actually
@nz
nz / Delete all documents in a Solr index using curl.md
Last active February 12, 2024 10:55
Delete all documents in a Solr index using curl
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl

curl "http://index.websolr.com/solr/a0b1c2d3/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

I'm amused at the traction this little gist is getting on Google! I would be remiss not to point out that six+ years later I'm still helping thousands of companies on a daily basis with their search index management, by providing managed Solr as a service over at Websolr, and hosted Elasticsearch at Bonsai. Check us out if you'd like an expert helping hand at Solr and Elasticsearch hosting, ops and support!