Skip to content

Instantly share code, notes, and snippets.

View guinslym's full-sized avatar

Guinslym guinslym

View GitHub Profile
anonymous
anonymous / Floating-Labels.markdown
Created April 16, 2014 20:10
A Pen by Rik Schennink.
#Sort the Ruby files in your project by LOC
find . -iname "*.rb" -type f -exec wc -l {} \; | sort -rn
#Sort the Ruby files in your project by number of has_many
ack " has_many " -c | awk -F ":" '{print $2,$1}' | grep -v "0" | sort -rn
@anupamshakya7
anupamshakya7 / Transformation_From_XSLT
Created April 25, 2014 11:11
How to transform an XML file using XSLT in Python
from lxml import etree
data = open('D:\Conversion\MACSXML_Parts.xslt')
xslt_content = data.read()
xslt_root = etree.XML(xslt_content)
dom = etree.parse('D:\Conversion\Cat2015UF.xml')
transform = etree.XSLT(xslt_root)
result = transform(dom)
f = open('D:\Conversion\MACSXML_Parts.csv', 'w')
f.write(str(result1))
@rtt
rtt / gist:5a2e0cfa638c938cca59
Created August 14, 2014 09:46
example python tinderbot
# encoding: utf8 1,1 Top# encoding: utf8
import argparse
from datetime import datetime
import json
from random import randint
import requests
import sys
from time import sleep
# vim: set ft=python :
from __future__ import print_function
import json
import sys
import datetime
from redis import StrictRedis as Redis
@ZengetsuFR
ZengetsuFR / suitcaseOnTheBus.py
Last active August 29, 2015 14:08
playing with chicago's public data
# -*- coding: utf-8 -*-
#exercise from "Learn Python Through Public Data Hacking" see youtube here : http://youtu.be/RrPZza_vZ3w
#Travis traveled to Chicago and took the Clark Street #22 bus up to Dave's office.
#Problem: He just left his suitcase on the bus!
#Your task: Get it back!
#Dave's office is located at:
# latitude =41.980262
@vigram
vigram / sidekiq_tasks.rake
Created December 11, 2014 12:09
Rake task to restart Sidekiq process
# Usage: bundle exec rake sidekiq:restart RAILS_ENV=<environment name>
namespace :sidekiq do
sidekiq_pid_file = Rails.root+'tmp/pids/sidekiq.pid'
desc "Sidekiq stop"
task :stop do
puts "#### Trying to stop Sidekiq Now !!! ####"
if File.exist?(sidekiq_pid_file)
puts "Stopping sidekiq now #PID-#{File.readlines(sidekiq_pid_file).first}..."
@ajaxray
ajaxray / KNPPaginatorConfig.yml
Last active May 25, 2017 11:13
Bootstrap 3 style pagination template for Symfony KnpPaginatorBundle.
# From http://stackoverflow.com/a/23035644/228648
# Update pagination config in config.yml as:
knp_paginator:
template:
pagination: AcmeBundle:Common:paginator-bootstrap.html.twig
@bobbygrace
bobbygrace / trello-css-guide.md
Last active May 12, 2025 16:46
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?