Skip to content

Instantly share code, notes, and snippets.

@askagirl
askagirl / getYoutubeVideoInfo.coffee
Created July 11, 2016 05:37 — forked from xissy/getYoutubeVideoInfo.coffee
Get a youtube video information from get_video_info.
request = require 'request'
youTubeMovieInfo =
youTubeMovieId: 'videoId'
url = "http://www.youtube.com/get_video_info?video_id=#{youTubeMovieInfo.youTubeMovieId}"
request.get url, (err, res, body) ->
return callback(false) if err
return callback(false) if res.statusCode isnt 200
@askagirl
askagirl / registrations_controller.rb
Created June 28, 2016 01:58 — forked from jwo/registrations_controller.rb
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@askagirl
askagirl / data-markdown.user.js
Created February 18, 2016 12:43 — forked from paulirish/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
{-# LANG BangPatterns #-}
-- module SillyMapBench (main) where
import qualified Data.Map.Strict as Map
loopCount = 1000000
-- loopCount = 10
texts = [ "The", "quick", "brown", "fox", "jumped",
"over", "the", "lazy", "dog", "at", "a", "restaurant",
@askagirl
askagirl / jenkins-git-backup.sh
Last active August 29, 2015 14:28 — forked from abayer/jenkins-git-backup.sh
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
### Keybase proof
I hereby claim:
* I am askagirl on github.
* I am askagirl (https://keybase.io/askagirl) on keybase.
* I have a public key whose fingerprint is BE10 3101 A61E B526 F541 8468 9281 4EE7 D97B ADFE
To claim this, I am signing this object:
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin