Skip to content

Instantly share code, notes, and snippets.

View icetee's full-sized avatar
:atom:
Development

Tamás András Horváth icetee

:atom:
Development
View GitHub Profile
@zilahir
zilahir / change-db.sh
Created January 3, 2019 21:52
change-db
#!/bin/bash
#This script changes the database with the latest file in repo's !sql folder. This script is triggered by a manual step in bitbucket pipeline
cd !sqldump;
latest_sql_file=`ls -Art | tail -n 1`;
cd ..
#connect to devel database and
#1. drop the current database there
TABLES=$(mysql --host <host> -u <user> -p<pass> <db-name> -e 'show tables' | awk '{ print $1}' | grep -v '^Tables' );
@afjoseph
afjoseph / stupid-spotlight.sh
Created October 19, 2017 07:32
When spotlight indexing turns to shit...
#!/bin/sh
# Reference: https://apple.stackexchange.com/questions/62715/applications-dont-show-up-in-spotlight
sudo mdutil -a -i off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo mdutil -a -i on /
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@aedm
aedm / meteordeps.js
Last active January 5, 2018 07:33
This script displays dependency relations between packages required by a Meteor project
"use strict";
const execSync = require('child_process').execSync;
const fs = require('fs');
function run(command) {
return execSync(command).toString().trim();
}
console.log("Reading 'versions' file...");
@joelpalmer
joelpalmer / adapter.ts
Created February 28, 2017 15:39
Adapter Pattern with TypeScript
//target (our payment object interface)
interface IPayment {
id: string;
total: number;
SubmitPayment: Function;
}
//our payment class
class Payment implements IPayment {
public id: string;
public total: number;
@hewerthomn
hewerthomn / install_oci8_ubuntu_16.04_php7.1.md
Created February 22, 2017 14:45
How to install OCI8 on Ubuntu 16.04 and PHP 7.1
@cferdinandi
cferdinandi / metabox-single.php
Last active March 15, 2023 01:33
Create a metabox with a single field
<?php
/**
* Create a metabox with a single field.
* Replace `_namespace` with some namespace for your project to avoid conflicts with other items
*/
//
// Create Metabox
//
@maxbrunsfeld
maxbrunsfeld / memory-leak-notes.md
Last active September 11, 2017 22:04
Avoiding memory leaks when using event listeners in Atom

Preventing Memory Leaks

Cleaning up event listeners

When subscribing to events using methods like atom.workspace.onDidAddTextEditor, it is important remove the event listeners when you no longer need your callback to be called (e.g. when your package is deactivated). To do this, store the returned Disposable, and call .dispose on it:

module.exports = {
  activate () {
 this.editorSubscription = atom.workspace.onDidAddTextEditor(editor =&gt; {
@raewrites
raewrites / disable-xml-rpc
Last active October 19, 2017 20:57
Disable XML-RPC
<Files xmlrpc.php>
Order Allow,Deny
Deny from all
</Files>
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active July 16, 2023 15:33
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi