Skip to content

Instantly share code, notes, and snippets.

View chriswk's full-sized avatar
🖥️
coding @Unleash

Christopher Kolstad chriswk

🖥️
coding @Unleash
View GitHub Profile
mysql> SELECT * FROM drug_status WHERE sid IN (SELECT status_id FROM drug_identification_status WHERE identification_id IN (SELECT sid FROM drug_identification WHERE drug_id = (SELECT sid FROM drug WHERE drug_id = 17364)));
+-----------------------+--------------------------------------+---------+---------------------+-------------------------+-------------+
| SID | STATUS_ID | COUNTRY | STATUS_DATE | STATUS_TEXT | STATUS_CODE |
+-----------------------+--------------------------------------+---------+---------------------+-------------------------+-------------+
| 81128409496221021918 | deed644d-ae4c-414c-9bb7-ca432663ae17 | NO | 2010-08-11 15:16:00 | Identifikasjon utg�tt | 80 |
| 820628409496220556985 | 419ee761-601b-4dce-8d15-6dda126aa9eb | NO | 2010-10-07 10:56:00 | Identifikasjon godkjent | 70 |
<VirtualHost *>
ServerName mittdomene.no
ServerAlias mittdomene.com
ServerAlias mittdomene.net
ServerAlias mittdomene.org
ServerAdmin [email protected]
DocumentRoot /var/www/mittdomene.com/docs
<Directory /var/www/mittdomene.com/docs>
Options Indexes FollowSymLinks
@chriswk
chriswk / validating.js
Created April 7, 2011 11:06
Validating for fun and profit
jQuery.validator.addMethod("simplePhoneNo", function(value, element) {
return this.optional(element) || value.match(/[\+\d{1-3}]?[\s]?\d+/);
})
var validator = $("#sendapplication").validate({
rules : {
phone: {
required: true,
simplePhoneNo: true
},
addressPostCode: {
function norLottoNumbers(n) { for(;n^7;)for(var a=[],i=0,n=0;++i<37;)Math.random()<.1?a[n++]=i:0;return a }
function norLottoNumbers(n) { for(;n^7;)for(var a=[],i=0,n=0;++i<37;)Math.random()<.1?a[n++]=i:0;return a }
@SuppressWarnings({"UtilityClassWithPublicConstructor"})
public final class YearMonthUtils {
private static final int START_YEAR = 1930;
private static final int END_DAY = 31;
private static final int MIN_AGE = 15;
private static I18nService i18nService;
private static ActionSupport actionSupport = new ActionSupport();
public YearMonthUtils(I18nService i18nService) {
public List<Long> getTaskIds(Long orgId, Long cvId) {
List<Long> taskIds = Lists.newArrayList();
List<Task> tasks = taskDao.findTasks(orgId, cvId);
for(Task task : tasks) {
taskIds.add(task.getTaskId());
}
return taskIds;
}
@chriswk
chriswk / fizzbuzz.py
Created October 31, 2011 11:54
fizzbuzz
def fizzBuzz(max):
for i in range(max):
print i%3/2*'fizz' + i%5/4*'buzz' or i+1
fizzBuzz(100)
(function () { alert('Hello world'); })();
#!/usr/bin/env groovy
import au.com.bytecode.opencsv.CSVReader
import au.com.bytecode.opencsv.CSVWriter
import groovy.transform.Canonical
@Grab(group = "net.sf.opencsv", module="opencsv", version="[2.3,)")
class SSBPositions {
def getJobs() {
def ssbUrl = "http://www.ssb.no/emner/06/yrke/yrke.sdv"