Skip to content

Instantly share code, notes, and snippets.

View drnikki's full-sized avatar

Dr. Nikki Stevens drnikki

View GitHub Profile
@drnikki
drnikki / in the shell
Created April 10, 2013 22:58
Stores a word and a number. I use it to count the number of times a certain word is used in a meeting.
# The word you want to add to, and the optional number to add to it.
mongo --eval "var theword='solve', thecount=5" write.js
Verifying that +drnikki is my blockchain ID. https://onename.com/drnikki
@drnikki
drnikki / upload.rb
Last active October 13, 2015 15:37
Skitch replacement, step 2
#!/usr/bin/env ruby
#JSON Parsing example
require "rubygems"
require "json"
# i don't like this at all....
photopath = "#{ARGV[0]}"
# running from within the repository
thecommand ="./openphoto -p -X POST -h YOUR_OPENPHOTO_HOST -e /photo/upload.json -F 'photo=@" + photopath + "' -F 'tags=REPLACEME,WITHTAGS' "
@drnikki
drnikki / gist:3947360
Created October 24, 2012 17:06
Export Skype chat history
sqlite3 ~/Library/Application\ Support/Skype/<YOUR SKYPENAME>/main.db "SELECT author,timestamp, body_xml FROM messages WHERE dialog_partner = '<OTHER SKYPENAME>'" > ~/Desktop/skype_chat_history.txt
@drnikki
drnikki / gist:3730281
Created September 15, 2012 23:09
git yo
git clone git@github.com:drnikki/laughing-cyril.git
cd laughing-cyril
echo "this is some text" >> rachel1.txt
git add rachel1.txt
git commit -m "I am my first commit"
git push origin master
@drnikki
drnikki / google_twunter_lol
Created July 30, 2012 20:04 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
@drnikki
drnikki / gist:2960578
Created June 20, 2012 15:45
Handy function to parse kanji out of sentences
function parseText(text) {
// simplified version of this guys' http://buildingonmud.blogspot.com/2009/06/convert-string-to-unicode-in-javascript.html
var charArray = text.split('');
var justKanji = [];
charArray.forEach( function(item) {
// rejection ranges found @unicodemap.com
// http://www.unicodemap.org/range/62/Hiragana/ & http://www.unicodemap.org/range/63/Katakana/
// 12352 - 12543
var unicode = item.charCodeAt(0);
if ($acct = user_load_by_name('admin')) {
echo "loaded user";
// this loads the user's profile 2 data, of the profile2
if ($profiletwo = profile2_load_by_user($acct->uid, 'part_1')) {
// and this returns just the term id of what they selected
print_r($profiletwo->field_part1_skills);
}
else {
echo "cannot load profile";
}
@drnikki
drnikki / gist:2363348
Created April 11, 2012 23:00
Mustachifyit
/**
* MUSTACHES FOR EVERYONE... kind of.
*/
(function($) {
Drupal.behaviors.mustache = {
attach: function() {
$("img")
.mouseover(function() {
@drnikki
drnikki / gist:2254721
Created March 30, 2012 20:22
block id
text
text
<a href="
<?php
$url = current_path();
explode('/', $url);
var_dump($url);
if(is_numeric($url[1])) {
 $nid = $url[1];
echo "node/add/resume?=jobxyz=" . $nid;