Skip to content

Instantly share code, notes, and snippets.

@gen-yamada
gen-yamada / express mysql
Created December 11, 2020 03:18
express connect-mysql nuxt.js
const express = require("express")
const app = express()
module.exports = {
path: "/server",
handler: app,
}
app.get("/category", (req, res) => {
const mysql = require("mysql")
@Larsklopstra
Larsklopstra / install.sh
Last active October 24, 2024 04:13
Ubuntu Laravel Development Environment
#!/bin/bash
echo '🏃 Starting setup...'
echo '--------------------'
sudo apt update
sudo apt upgrade
echo '🐠🚀 Installing Fish and Starship...'
@sinclairtarget
sinclairtarget / bernoulli.c
Created August 17, 2018 20:22
Lovelace's Note G Program in C
#include <stdio.h>
/*
* Calculates what Ada Lovelace labeled "B7", which today we would call the 8th
* Bernoulli number.
*/
int main(int argc, char* argv[])
{
// ------------------------------------------------------------------------
// Data
@zergius-eggstream
zergius-eggstream / shift-selectable.js
Created March 13, 2017 10:08
jQuery plugin for shift + click to select multiple checkboxes (https://gist.github.com/AndrewRayCode/3784055 modified for live collections support)
// usage: $('.container').shiftSelectable() to select all checkboxes in container $('.cont')
// or $('.container').shiftSelectable({items: '.shift-selectable'}) to select only checkboxes with shift-selectable class
$.fn.shiftSelectable = function(config) {
config = $.extend({
items: 'input[type="checkbox"]'
}, config);
var $container = this;
var lastChecked;
$container.on('click', config.items, function(evt) {
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 2, 2024 05:46
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@alixaxel
alixaxel / y.php
Last active October 13, 2016 12:41
Why...
<?php
namespace alixaxel;
class y
{
public static function Coalesce()
{
foreach (func_get_args() as $argument) {
if (isset($argument) === true) {
@benbalter
benbalter / wp-db.tutorial.php
Created January 13, 2012 18:41
WordPress DB Tutorial
<?php
//absolute path to wp-load.php, or relative to this script
//e.g., ../wp-core/wp-load.php
include( 'trunk/wp-load.php' );
//grab the WPDB database object, using WP's database
//more info: http://codex.wordpress.org/Class_Reference/wpdb
global $wpdb;
@berkayunal
berkayunal / isimler.sql
Created November 25, 2011 04:50 — forked from ismailbaskin/turkce_isimler.sql
isim sözlüğü
CREATE TABLE `isimler` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`ad` varchar(255) COLLATE utf8_bin NOT NULL,
`cinsiyet` varchar(50) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ad` (`ad`),
KEY `cinsiyet` (`cinsiyet`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;