Skip to content

Instantly share code, notes, and snippets.

View chadsten's full-sized avatar
💭
Facepalming at my own terrible code since 2005

Chadsten chadsten

💭
Facepalming at my own terrible code since 2005
  • Colorado
View GitHub Profile
@patrickfuller
patrickfuller / github_issues_to_csv.py
Last active November 30, 2022 10:03 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports issues from a list of repositories to individual csv files.
Uses basic authentication (Github username + password) to retrieve issues
from a repository that username has access to. Supports Github API v3.
Forked from: unbracketed/export_repo_issues_to_csv.py
"""
import argparse
import csv
from getpass import getpass
import requests
@johnny5th
johnny5th / em.scss
Last active February 1, 2016 21:04
@function em($px, $context-or-rem: strip_unit($base-font-size)) {
@if($context-or-rem == true) {
@return $px / strip_unit($base-font-size) * 1rem;
} @else {
@return $px / $context-or-rem * 1em;
}
}
/// Remove the unit of a length
/// @param {Number} $number - Number to remove unit from
@staringispolite
staringispolite / asciiputsonglasses
Last active March 22, 2024 06:39
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
@SharaaEsper
SharaaEsper / sslishard.txt
Created January 12, 2015 23:11
How I SSL
Split certs into site.com.crt and site.com.ca.crt
# ls ssl/
tmpkey www.<DOMAIN>.com.ca.crt www.<DOMAIN>.com.crt www.<DOMAIN>.com.csr www.<DOMAIN>.com.key
.ca.crt, .crt and .key are the needed files, the rest can be removed.
In /etc/httpd/conf.d/ssl.conf I commented out the default vhost (Starting with <Virutalhost> and through the rest of the file)
In /etc/httpd/conf.d/ssl.conf I added a NameVirtualHost directive. THis lets SNI work if you get more SSL sites in the future.
module_load_include('inc', 'pathauto');
$variables['classes_array'][] = "taxonomy-" . pathauto_cleanstring($node->field_experience_category['und'][0]['taxonomy_term']->name);
<?php
# Unit test for paths imported by feeds
# Not amazing, but will gather 404 info
main();
function main() {
$paths = parse_csv('all-paths.csv',',');
$compare_path = compare_paths($paths);
function drupal-install() {
# Remove existing database
drush sql-drop -y;
# Remove existing install
sudo rm -rf sites/default;
# Restore the sites/default/default.settings.php file
sudo git checkout -- sites/default;
# Temporarily make the sites/default writable by anyone
sudo chmod -R 777 sites/default;
# Ensure the owner is the current user, not root user
@SharaaEsper
SharaaEsper / gist:6504718
Created September 10, 2013 03:47
Basic redirect
server [
listen 80;
server_name DOMAIN.COM WWW.DOMAIN.COM;
location / {
return 301 http://otherdomain.com;
}