This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in $(gcloud beta firestore indexes composite list --format=text|grep "name:"|awk -F ' ' '{print $2}') | |
do | |
echo "Deleting $i" | |
gcloud beta firestore indexes composite delete "${i}" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff --no-prefix [<other git-diff arguments>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"reflect" | |
) | |
// StructCopy Copies the common field values from source to target. Pass the pointers of the interfaces | |
func StructCopy(source interface{}, target interface{}) { | |
sourceElem := reflect.ValueOf(source).Elem() | |
targetElem := reflect.ValueOf(target).Elem() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -n "$CI_BUILD_REF_NAME" ]; then | |
branch_name=$CI_BUILD_REF_NAME | |
else | |
branch_name=$(git symbolic-ref -q HEAD) | |
branch_name=${branch_name##refs/heads/} | |
branch_name=${branch_name:-HEAD} | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
ui "github.com/gizak/termui" | |
"log" | |
"sync" | |
"time" | |
) | |
type UiElements struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"strings" | |
"time" | |
) | |
type Duration struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
isNonPlayAppAllowed = Settings.Secure.getInt(context.getContentResolver(), Settings.System.INSTALL_NON_MARKET_APPS) == 1; | |
Log.d(TAG, "Unknown sources check: "+ Boolean.toString(isNonPlayAppAllowed)); | |
} catch (SettingNotFoundException e) { | |
e.printStackTrace(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -f /tmp/foo.txt ] | |
then | |
echo the file does not exist | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getTableStructure(self, table_name): | |
"""Returns table structure""" | |
query = "PRAGMA table_info('" + table_name +"')" | |
try: | |
result = cursor.execute(query) | |
fields = result.fetchall() | |
return fields | |
except sqlite3.Error, e: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parent_item = my_model.invisibleRootItem() | |
root_item = QtGui.QStandardItem(QtCore.QString("Group 1")) | |
parent_item.appendRow(root_item) | |
parent_item = root_item | |
parent_item.appendRow( | |
[ | |
QtGui.QStandardItem(QtCore.QString("Data 1"))), | |
QtGui.QStandardItem(QtCore.QString("Data 2"))), | |
QtGui.QStandardItem(QtCore.QString("Data 3"))) |
NewerOlder